﻿friends = {}

-- 1 = Yellow 4-point Star
-- 2 = Orange Circle
-- 3 = Purple Diamond
-- 4 = Green Triangle
-- 5 = White Crescent Moon
-- 6 = Blue Square
-- 7 = Red "X" Cross
-- 8 = White Skull

friends["Bannen"] = 2
friends["Cgy"] = 2
friends["Entyune"] = 6
friends["Shotsshots"] = 6
friends["Slamchop"] = 6
friends["Xõrcist"] = 7
friends["Katsamoto"] = 1
friends["Xõrcíst"] = 7
friends["Põqweíst"] = 7
friends["Protectorqt"] = 1
friends["Chemicáls"] = 8
friends["Dezardria"] = 4
friends["Cardasnipes"] = 3

local function settargets()
	for name,mark in pairs(friends) do 
		if ( GetRaidTargetIndex(name) ~= mark ) then
			--print (name, mark)
			SetRaidTarget(name,mark)
		end
	end

end


local total = 0

local function onUpdate(self,elapsed)
    total = total + elapsed
    if total >= 2 then
		if ( UnitIsGroupLeader("player") ) then
			settargets()
			total = 0
		end
    end
end


local f = CreateFrame("frame")
f:SetScript("OnUpdate", onUpdate)